package com.stadium.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.stadium.bean.Equipment;

public interface EquipmentRepository extends JpaRepository<Equipment, Integer> {
	
	@Query("SELECT e FROM Equipment e WHERE e.name=?1")
	Equipment getByName(String name);
	
	//根据status返回未被删除的器材信息
	@Query("SELECT e FROM Equipment e WHERE e.status=0")
	List<Equipment> getAllEquips();
	
}
